package interfaces;

/**
 * Clase InterfazDatos.
 * 
 * @author David González Requejo.
 */

public class InterfazDatos extends javax.swing.JFrame {

    private final int identificador;
    
    private String nombre;
    
    /**
     * Crea un objeto de la clase InterfazDatos.
     * 
     * @param identificador Valor de tipo int que representa el identificador del usuario.
     */
    
    public InterfazDatos( int identificador ) {
        
        this.identificador = identificador;
        
        initComponents();
        setDatosTutor();
        
    }

    /**
     * Establece los datos del curso del tutor.
     */
    
    private void setDatosTutor() {
        
        nombre = new utilidades.Cursos().getNombrePersona( identificador );
        bienvenidaJLabel.setText( "¡Bienvenido " + nombre + "!" );
        
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        contenedorInterfazDatosJPanel = new javax.swing.JPanel();
        bienvenidaContenedorJPanel = new javax.swing.JPanel();
        fotoJPanel = new javax.swing.JPanel();
        bienvenidaJLabel = new javax.swing.JLabel();
        salirJButton = new javax.swing.JButton();
        abrirPuertaJButton = new javax.swing.JButton();
        barraSuperiorJMenuBar = new javax.swing.JMenuBar();
        archivoJMenu = new javax.swing.JMenu();
        salirJMenuItem = new javax.swing.JMenuItem();
        ayudaJMenu = new javax.swing.JMenu();
        manualJMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(720, 480));
        setPreferredSize(new java.awt.Dimension(720, 480));

        bienvenidaContenedorJPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Bienvenida"));

        fotoJPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        fotoJPanel.setMaximumSize(new java.awt.Dimension(120, 120));
        fotoJPanel.setMinimumSize(new java.awt.Dimension(120, 120));

        javax.swing.GroupLayout fotoJPanelLayout = new javax.swing.GroupLayout(fotoJPanel);
        fotoJPanel.setLayout(fotoJPanelLayout);
        fotoJPanelLayout.setHorizontalGroup(
            fotoJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 118, Short.MAX_VALUE)
        );
        fotoJPanelLayout.setVerticalGroup(
            fotoJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 118, Short.MAX_VALUE)
        );

        bienvenidaJLabel.setText("¡Bienvenido Usuario!");

        salirJButton.setText("Salir");

        javax.swing.GroupLayout bienvenidaContenedorJPanelLayout = new javax.swing.GroupLayout(bienvenidaContenedorJPanel);
        bienvenidaContenedorJPanel.setLayout(bienvenidaContenedorJPanelLayout);
        bienvenidaContenedorJPanelLayout.setHorizontalGroup(
            bienvenidaContenedorJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bienvenidaContenedorJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(fotoJPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(bienvenidaContenedorJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bienvenidaJLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 540, Short.MAX_VALUE)
                    .addGroup(bienvenidaContenedorJPanelLayout.createSequentialGroup()
                        .addComponent(salirJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        bienvenidaContenedorJPanelLayout.setVerticalGroup(
            bienvenidaContenedorJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bienvenidaContenedorJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(bienvenidaContenedorJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bienvenidaContenedorJPanelLayout.createSequentialGroup()
                        .addComponent(bienvenidaJLabel)
                        .addGap(72, 72, 72)
                        .addComponent(salirJButton))
                    .addComponent(fotoJPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(253, Short.MAX_VALUE))
        );

        abrirPuertaJButton.setText("Abrir puerta");

        javax.swing.GroupLayout contenedorInterfazDatosJPanelLayout = new javax.swing.GroupLayout(contenedorInterfazDatosJPanel);
        contenedorInterfazDatosJPanel.setLayout(contenedorInterfazDatosJPanelLayout);
        contenedorInterfazDatosJPanelLayout.setHorizontalGroup(
            contenedorInterfazDatosJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(contenedorInterfazDatosJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(contenedorInterfazDatosJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bienvenidaContenedorJPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, contenedorInterfazDatosJPanelLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(abrirPuertaJButton)))
                .addContainerGap())
        );
        contenedorInterfazDatosJPanelLayout.setVerticalGroup(
            contenedorInterfazDatosJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(contenedorInterfazDatosJPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(bienvenidaContenedorJPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(abrirPuertaJButton)
                .addContainerGap())
        );

        archivoJMenu.setText("Archivo");

        salirJMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        salirJMenuItem.setText("Salir");
        archivoJMenu.add(salirJMenuItem);

        barraSuperiorJMenuBar.add(archivoJMenu);

        ayudaJMenu.setText("Ayuda");

        manualJMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        manualJMenuItem.setText("Manual de usuario");
        ayudaJMenu.add(manualJMenuItem);

        barraSuperiorJMenuBar.add(ayudaJMenu);

        setJMenuBar(barraSuperiorJMenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(contenedorInterfazDatosJPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(contenedorInterfazDatosJPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton abrirPuertaJButton;
    private javax.swing.JMenu archivoJMenu;
    private javax.swing.JMenu ayudaJMenu;
    private javax.swing.JMenuBar barraSuperiorJMenuBar;
    private javax.swing.JPanel bienvenidaContenedorJPanel;
    private javax.swing.JLabel bienvenidaJLabel;
    private javax.swing.JPanel contenedorInterfazDatosJPanel;
    private javax.swing.JPanel fotoJPanel;
    private javax.swing.JMenuItem manualJMenuItem;
    private javax.swing.JButton salirJButton;
    private javax.swing.JMenuItem salirJMenuItem;
    // End of variables declaration//GEN-END:variables
}
